\hypertarget{dispatcher_8h}{
\section{dispatcher.h File Reference}
\label{dispatcher_8h}\index{dispatcher.h@{dispatcher.h}}
}
Various function definitions for \hyperlink{dispatcher_8c}{dispatcher.c}.  


{\tt \#include \char`\"{}config.h\char`\"{}}\par
{\tt \#include \char`\"{}robot.h\char`\"{}}\par
\subsection*{Defines}
\begin{CompactItemize}
\item 
\#define \hyperlink{dispatcher_8h_04d2006f6397ebadc06df7f74e1b2cc5}{MAX\_\-DEVICE\_\-FUNCTIONS}~100
\end{CompactItemize}
\subsection*{Functions}
\begin{CompactItemize}
\item 
void \hyperlink{dispatcher_8h_e55dbdf443ce70f44dae537b4c1969ff}{init\_\-dispatcher} (void)
\item 
void \hyperlink{dispatcher_8h_4702d5590338297f30cf7058471bba60}{dispatch} (uint8\_\-t $\ast$cmd, uint8\_\-t $\ast$data, uint8\_\-t length)
\item 
void \hyperlink{dispatcher_8h_8cde8adafa0c103a1a0e5d0290631738}{register\_\-action} (uint8\_\-t device\_\-type, uint8\_\-t function\_\-id, void($\ast$function)(uint8\_\-t id, uint8\_\-t $\ast$data, uint8\_\-t length))
\end{CompactItemize}


\subsection{Detailed Description}
Various function definitions for \hyperlink{dispatcher_8c}{dispatcher.c}. 

\begin{Desc}
\item[Author:]Robert Breznak, Peter Kalauskas \end{Desc}


\subsection{Define Documentation}
\hypertarget{dispatcher_8h_04d2006f6397ebadc06df7f74e1b2cc5}{
\index{dispatcher.h@{dispatcher.h}!MAX\_\-DEVICE\_\-FUNCTIONS@{MAX\_\-DEVICE\_\-FUNCTIONS}}
\index{MAX\_\-DEVICE\_\-FUNCTIONS@{MAX\_\-DEVICE\_\-FUNCTIONS}!dispatcher.h@{dispatcher.h}}
\subsubsection[{MAX\_\-DEVICE\_\-FUNCTIONS}]{\setlength{\rightskip}{0pt plus 5cm}\#define MAX\_\-DEVICE\_\-FUNCTIONS~100}}
\label{dispatcher_8h_04d2006f6397ebadc06df7f74e1b2cc5}


The max number of devices function. This will be used as the size of the device functions array. 

\subsection{Function Documentation}
\hypertarget{dispatcher_8h_4702d5590338297f30cf7058471bba60}{
\index{dispatcher.h@{dispatcher.h}!dispatch@{dispatch}}
\index{dispatch@{dispatch}!dispatcher.h@{dispatcher.h}}
\subsubsection[{dispatch}]{\setlength{\rightskip}{0pt plus 5cm}void dispatch (uint8\_\-t $\ast$ {\em cmd}, \/  uint8\_\-t $\ast$ {\em data}, \/  uint8\_\-t {\em length})}}
\label{dispatcher_8h_4702d5590338297f30cf7058471bba60}


Dispatches a message which is received by the robot.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em cmd}]an array of lenth 3 containing the device type, device id, and function id. \item[{\em data}]the data to be passed to the function. \item[{\em length}]the length of the data being passed to the function. \end{description}
\end{Desc}
\begin{Desc}
\item[Author:]Robert Breznak, Peter Kalauskas \end{Desc}
\hypertarget{dispatcher_8h_e55dbdf443ce70f44dae537b4c1969ff}{
\index{dispatcher.h@{dispatcher.h}!init\_\-dispatcher@{init\_\-dispatcher}}
\index{init\_\-dispatcher@{init\_\-dispatcher}!dispatcher.h@{dispatcher.h}}
\subsubsection[{init\_\-dispatcher}]{\setlength{\rightskip}{0pt plus 5cm}void init\_\-dispatcher (void)}}
\label{dispatcher_8h_e55dbdf443ce70f44dae537b4c1969ff}


Initializes the dispatcher by wiping the device function array and setting the index to 0.

\begin{Desc}
\item[Author:]Robert Breznak, Peter Kalauskas \end{Desc}
\hypertarget{dispatcher_8h_8cde8adafa0c103a1a0e5d0290631738}{
\index{dispatcher.h@{dispatcher.h}!register\_\-action@{register\_\-action}}
\index{register\_\-action@{register\_\-action}!dispatcher.h@{dispatcher.h}}
\subsubsection[{register\_\-action}]{\setlength{\rightskip}{0pt plus 5cm}void register\_\-action (uint8\_\-t {\em device\_\-type}, \/  uint8\_\-t {\em function\_\-id}, \/  void($\ast$)(uint8\_\-t id, uint8\_\-t $\ast$data, uint8\_\-t length) {\em function})}}
\label{dispatcher_8h_8cde8adafa0c103a1a0e5d0290631738}


Registers a given action for a device type and function ID.

\begin{Desc}
\item[Author:]Robert Breznak, Peter Kalauskas \end{Desc}
